# -*-coding:utf-8 -*-
from django.contrib.auth.models import User
from rest_framework import authentication
from rest_framework import exceptions


class UrlTokenAuthentication(authentication.TokenAuthentication):
    def authenticate(self, request):
        key = request.GET.get('token', None)
        if not key:
            return None

        return self.authenticate_credentials(key)
